<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:jsp="http://java.sun.com/JSP/Page"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Problem Database Manager</title>        
        <link href="#{request.contextPath}/template/portal.css" rel="stylesheet" type="text/css" media="screen"/>
    </head>

    <body>
        <div id="wrap">
            <div id="header">
                <h:form>
                        
                    <rich:modalPanel id="panel" width="350" height="100">
                        <f:facet name="header">
                            <h:panelGroup>
                                <rich:spacer width="3%"></rich:spacer>
                                <label>Atenção</label>
                            </h:panelGroup>
                        </f:facet>
                        <f:facet name="controls">
                            <h:commandLink onclick="#{rich:component('panel')}.hide()" value="[X]"/>
                        </f:facet>
                        <h:outputText value="Você tem certeza de que deseja fechar essa sessão?"></h:outputText>
                        <br/><br/>
                        <h:commandLink action="#{professor.logout}" value="Sim" styleClass="button"/>
                        <rich:spacer width="15%"></rich:spacer>
                        <h:commandLink onclick="#{rich:component('panel')}.hide()" value="Não" styleClass="button"/><br/>
                    </rich:modalPanel>
                    <h1>Problem Database Manager</h1>
                    <h2>Deixe sua criatividade se tornar um problema =)</h2>
                </h:form>
            </div>

            <tr align="center">
                <td width="100%">
                    <h:form>
                        <rich:toolBar width="700px" itemSeparator="line">
                            <rich:menuItem  action="welcome" value="Home" immediate="true" />
                            <rich:dropDownMenu>
                                <f:facet name="label">
                                    <h:panelGrid cellpadding="0" cellspacing="0" columns="2"
                                                 styleClass="rich-menu-item">
                                        <h:outputText value="Problema" />
                                    </h:panelGrid>
                                </f:facet>
                                <rich:menuItem  action="#{problema.createSetup}" value="Novo" immediate="true"/>
                                <rich:menuSeparator id="menuSeparator1" />
                                <rich:menuItem  action="#{problema.listSetup}" value="Listar" immediate="true" />
                                <rich:menuSeparator id="menuSeparator2" />
                                <rich:menuItem  action="#{problema.buscaSetup2}" value="Buscar" immediate="true" />
                            </rich:dropDownMenu>
                            <rich:dropDownMenu>
                                <f:facet name="label">
                                    <h:panelGrid cellpadding="0" cellspacing="0" columns="2"
                                                 styleClass="rich-menu-item">
                                        <h:outputText value="Disciplina" />
                                    </h:panelGrid>
                                </f:facet>
                                <rich:menuItem  action="#{disciplina.createSetup}" value="Nova" immediate="true"
                                                rendered="#{!professor.render}"/>
                                <rich:menuSeparator id="menuSeparator3" rendered="#{!professor.render}"/>/>
                                <rich:menuItem  action="#{disciplina.listSetup}" value="Listar" immediate="true" />
                            </rich:dropDownMenu>
                            <rich:dropDownMenu>
                                <f:facet name="label">
                                    <h:panelGrid cellpadding="0" cellspacing="0" columns="2"
                                                 styleClass="rich-menu-item">
                                        <h:outputText value="Grupos" />
                                    </h:panelGrid>
                                </f:facet>
                                <rich:menuItem  action="#{grupoProfessor.createSetup}" value="Novo" immediate="true"
                                                rendered="#{!professor.render}"/>/>
                                <rich:menuSeparator id="menuSeparator4" rendered="#{!professor.render}"/>/>
                                <rich:menuItem  action="#{grupoProfessor.listSetup}" value="Listar" immediate="true" />
                            </rich:dropDownMenu>
                            <rich:dropDownMenu>
                                <f:facet name="label">
                                    <h:panelGrid cellpadding="0" cellspacing="0" columns="2"
                                                 styleClass="rich-menu-item">
                                        <h:outputText value="Usuários" />
                                    </h:panelGrid>
                                </f:facet>
                                <rich:menuItem  action="#{professor.createSetup}" value="Novo" immediate="true"
                                                rendered="#{!professor.render}"/>/>
                                <rich:menuSeparator id="menuSeparator5" rendered="#{!professor.render}"/>/>
                                <rich:menuItem  action="#{professor.listSetup}" value="Listar" immediate="true" />
                            </rich:dropDownMenu>
                        </rich:toolBar>
                    </h:form>
                    <br/>
                </td>
            </tr>

            <!-- start content -->

            <div id="content">
                <br/>
                <div id="scrollable">
                    <div id="left">
                        <h:panelGroup id="messagePanel" layout="block" styleClass="">
                            <h4> <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/> </h4>
                        </h:panelGroup>
                        <div style="padding: 5px 10px 1px 0; "/>
                        <ui:insert name="content"/>
                    </div>
                    <div style="clear:both;"> </div>
                </div>
            </div>

            <div id="bottom"> </div>
            <div id="footer">&copy; Copyright by <a href="http://ecomp.uefs.br/problem_manager">Problem Manager</a> | Design adapted by Maria Alice Leal from <a href="http://www.opendesigns.org/preview/?template=1913">OpenDesign</a></div>
        </div>
    </body>
</html>